Skip to content

feat: opt-in auto-open for pasted work/user links#80

Open
wsxiaolin wants to merge 1 commit into
mainfrom
codex/add-link-auto-open-feature
Open

feat: opt-in auto-open for pasted work/user links#80
wsxiaolin wants to merge 1 commit into
mainfrom
codex/add-link-auto-open-feature

Conversation

@wsxiaolin
Copy link
Copy Markdown
Member

Motivation

  • Provide a convenient way to open copied experiment/discussion/profile links directly from the clipboard while keeping it opt-in and respecting permissions and error handling.

Description

  • Added a new settings toggle autoOpenCopiedLink (default off) to src/config/user.config.ts to enable/disable the feature from Settings.
  • Added localization keys settings.autoOpenCopiedLink in all supported locales under src/i18n/* so the setting is translatable.
  • Implemented a global paste handler in src/main.ts that parses pasted text for known patterns (examples: https://dl.turtlesim.com/plc/?chinese-experiment-<id>?, #/p/Discussion/<id>, <experiment=<id>>, <user=<id>>) and navigates to the corresponding route when enabled.
  • Enforced permission and error handling by requiring login for user-profile jumps, showing a warning if not logged in, and capturing route/navigation failures to window.$ErrorLogger while showing an error toast.

Testing

  • Ran npm run lint:i18n and the i18n key consistency check passed.
  • Ran npm run build and the project built successfully for production.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant